<template>
  <div>
    <CategorySelector :disabled="!isShowAttrList" />
    <AttrList
      v-if="isShowAttrList"
      @setIsShowAttrList="setIsShowAttrList"
      @setAttr="attr = $event"
    />
    <SaveAttr
      v-else
      :current-attr="attr"
      @setIsShowAttrList="setIsShowAttrList"
    />
  </div>
</template>

<script>
import AttrList from './components/AttrList.vue'
import SaveAttr from './components/SaveAttr.vue'

export default {
  name: 'Attr',
  components: {
    AttrList,
    SaveAttr
  },
  data() {
    return {
      isShowAttrList: true,
      attr: {
        // 属性名
        attrName: '',
        // 属性值列表
        attrValueList: []
      }
    }
  },
  methods: {
    setIsShowAttrList(isShowAttrList) {
      this.isShowAttrList = isShowAttrList
    }
  }
}
</script>

<style></style>
